<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/browser.js"></script>
    <script src="js/react.development.js"></script>
    <script src="js/react-dom.development.js"></script>
</head>
<body>
    <div id="div1"></div>
    
</body>
<script type="text/babel">
    // 组件
    class Cmp1 extends React.Component{
        constructor(...args){
            super(...args);

            this.name = '贾鹏';
        }
        render(){
            let data = [
                {name:'3232',age:18},
                {name:'32321',age:10},
                {name:'323223',age:182},
            ]
            return (
                <div>
                    <ul>
                            {data.map((json,index)=>(
                                <li>{index}:{json.name}:{json.age}</li>
                            ))}
                    </ul>
                </div>
                
                
            );
        }
    }

    let root = document.getElementById('div1');

    ReactDOM.render(
        <div className='box'>
            <label htmlFor='user'>用户名：</label>
            <input id='user' type='text'/>
            <Cmp1></Cmp1>
        </div>,
        root
    );


</script>
</html>